package com.ruihu.admin.module.system.user.domain.dto;

import com.ruihu.admin.util.VerificationUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;
import java.util.List;

/**
 * 添加员工
 *
 * @author lidoudou
 * @date 2017年12月19日下午2:06:31
 */
@Data
public class UserAddDTO {

    @ApiModelProperty("工号")
    @NotNull(message = "工号不能为空")
    private String workNo;

    @ApiModelProperty("姓名")
    @NotNull(message = "姓名不能为空")
    private String actualName;

    @ApiModelProperty("用户名")
    @NotNull(message = "用户名不能为空")
    private String username;

    @ApiModelProperty("别名")
    private String nickName;

    @ApiModelProperty("部门id")
    @NotNull(message = "部门id不能为空")
    private Long departmentId;

    @ApiModelProperty("手机号")
    @NotNull(message = "手机号不能为空")
    @Pattern(regexp = VerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
    private String phone;

    @ApiModelProperty("密码")
    @NotNull(message = "密码不能为空")
    @Length(min = 6, message = "密码最少为6位字符")
    private String password;

    @ApiModelProperty("确认密码")
    @NotNull(message = "确认密码不能为空")
    @Length(min = 6, message = "确认密码最少为6位字符")
    private String passwordAgain;

    @ApiModelProperty("用户类型")
    private Integer userType;

    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("身份证号码")
    private String idCard;

    @ApiModelProperty("出生日期")
    private Date birthday;

    @ApiModelProperty("职务id集合")
    private List<Long> positionIdList;

    @ApiModelProperty("角色ID")
    private Long roleId;

    @ApiModelProperty("是否离职")
    private Integer isLeave;

    @ApiModelProperty("描述")
    @Length(max = 200, message = "描述最多200个字符")
    private String remark;

}
